package game.leon.engine.net.codec;

import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;

/**
 * User: bianpeng
 * Date: 11-12-28
 * 上行消息, 不支持消息合并, 有一条发一条.
 * 下行需要支持消息合并
 */
public class GameCodecFactory implements ProtocolCodecFactory {
    private ProtocolEncoder encoder;
    private ProtocolDecoder decoder;
    public GameCodecFactory() {
        decoder = new GameProtocolDecoder();
        encoder = new GameProtocolEncoder();
    }
    @Override
    public ProtocolEncoder getEncoder(IoSession session) throws Exception {
        return encoder;
    }
    @Override
    public ProtocolDecoder getDecoder(IoSession session) throws Exception {
        return decoder;
    }
}
